import { ref } from 'vue'
import type { FormState } from './useOrderForm'

export const useMapDialog = (form: FormState) => {
    const mapDialogVisible = ref(false)

    const openMap = () => {
        mapDialogVisible.value = true
    }

    const updateAddress = (address: string) => {
        form.address = address
    }

    const closeMap = () => {
        mapDialogVisible.value = false
    }

    return {
        mapDialogVisible,
        openMap,
        updateAddress,
        closeMap
    }
} 